<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>内部表单</title>
</head>
<body>
<form th:action="@{/chapter19/completeTask(taskId=${taskId})}" method="post">
    <table style="width: 300px;margin: 0 auto;">
        <tr th:each="prop : ${formProperties}">
            <td th:text="${prop.name}"/>
            <td th:switch="${prop.type.name}">
                <input th:case="string" type="text" th:name="${prop.id}" th:value="${prop.value}"/>
                <input th:case="long" type="number" th:name="${prop.id}" th:value="${prop.value}"/>
                <select th:case="enum" th:name="${prop.id}" th:checked="${prop.value}">
                    <option th:each="enumValue : ${prop.type.getInformation('values')}" th:value="${enumValue.key}" th:text="${enumValue.value}"/>
                </select>
                <input th:case="date" type="date" th:name="${prop.id}" th:value="${prop.value}"/>
            </td>
        </tr>
        <tr>
            <td colspan="2" align="center"><input type="submit" value="提交"/></td>
        </tr>
    </table>
</form>
</body>
</html>